{% extends "wiki/base.html" %}
{% from "wiki/includes/sidebar_modules.html" import document_tools with context %}
{% set title = _('Delete Revision | {document}')|f(document=document.title) %}
{% set crumbs = [(document.get_absolute_url(), document.title),
                 (None, _('Delete Revision'))] %}

{% block content %}
  <div class="grid_9">
    <article id="delete-revision">
      {% if only_revision %}
        <h1 class="title">{{ _('Unable to delete only revision of the document') }}</h1>
        <p>{{ _('To delete the document, please notify an admin.') }}</p>
        <div class="submit">
          <a href="{{ url('wiki.document_revisions', document.slug) }}">{{ _('Go back to document history') }}</a>
        </div>
      {% else %}
        <h1 class="title">{{ _('Are you sure you want to delete this revision?') }}</h1>
        {% if has_votes %}
          <h3>{{ _('<strong>Warning:</strong> This revision has KB Helpfulness Votes associated with it. Deleting this revision will cause those votes to be deleted as well.') }}</h3>
        {% endif %}
        <label>{{ _('Creator') }}</label>
        <div>{{ revision.creator }}</div>
        <label>{{ _('Date') }}</label>
        <div>{{ datetimeformat(revision.created, format='longdatetime') }}</div>
        <label>{{ _('Content') }}</label>
        <pre>{{ revision.content }}</pre>
        <form action="" method="post">
          {% csrf_token %}
          <p>
            {{ _('You are about to permanently delete this revision. <strong>This cannot be undone!</strong> Are you sure you want to continue?')|safe }}
          </p>
          <div class="submit">
            <input type="submit" value="{{ _('Delete') }}" />
            <a href="{{ url('wiki.document_revisions', document.slug) }}">{{ _('Cancel and go back to document history') }}</a>
          </div>
        </form>
      {% endif %}
    </article>
  </div>
{% endblock %}

{% block side_top %}
  {{ document_tools(document, document.parent, user, '', settings) }}
{% endblock %}
